package org.phone.manager.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "product", catalog = "phonemanager")
public class Product extends EntityParent {

	private ProductType productType;
	private Integer order;
	private String pName;
	private Float pPrice;
	private String notes;
	
	public Product() {
	}

	public Product(ProductType productType, Integer order, String PName, Float PPrice, String notes) {
		this.productType = productType;
		this.order = order;
		this.pName = PName;
		this.pPrice = PPrice;
		this.notes = notes;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "type_id")
	public ProductType getProductType() {
		return this.productType;
	}

	public void setProductType(ProductType productType) {
		this.productType = productType;
	}

	@Column(name = "order_id")
	public Integer getOrder() {
		return this.order;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}

	@Column(name = "p_name", length = 45)
	public String getpName() {
		return this.pName;
	}

	public void setpName(String PName) {
		this.pName = PName;
	}

	@Column(name = "p_price", precision = 12, scale = 0)
	public Float getpPrice() {
		return this.pPrice;
	}

	public void setpPrice(Float PPrice) {
		this.pPrice = PPrice;
	}

	@Column(name = "notes", length = 200)
	public String getNotes() {
		return this.notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

}
